//	Company:	HTHK
//	NAME:	    MonthOptions.java
//	TITLE:	    The option of Month in Time Sheet System
//	FUNCTION:	The option of Month
//	BY:	        Kodak Xu
//	DATE:	    09/12/2003
// --------------------------------------------------------------
// MODIFICATION HISTORY
// --------------------------------------------------------------
//	CR Log #:  99999  BY:  XXXX   DATE:  dd/mm/yyyy
//	ERROR:	XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
//	FIX:	XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// --------------------------------------------------------------

package tss.options;

import tss.common.Options2;
import java.util.ArrayList;
import java.sql.Connection;

public class MonthOptions
  extends Options2
{ 
  public MonthOptions() {
      this.load();
  }

  @Override
protected ArrayList createOptions(Connection con)
    throws Exception
  {
      ArrayList options = new ArrayList();
      for (int i=0; i<12; i++)
      {
          Options2.Option option
          = new Options2.Option(gettxt(2,i+1),gettxt(2,i+1));
          options.add(i,option);
      }
      return options;
  }

  public String gettxt(int bits,int value)
	{
		String values = ""+value;
		String txt="";
		int wide=values.length();
		while (bits-wide>0)
		{
			txt += "0";
			wide++;
		}
		txt += values;
		return txt;
	}
}
